package com.example.day09.ex01;

import java.util.ArrayList;

/**
 * @author 17976
 */
public class ArrayListDemo02 {
    public static void main(String[] args) {

        ArrayList<String> array = new ArrayList<String>();

        array.add("hello");
        array.add("world");
        array.add("java");
//public boolean remove(Object o)：
// System.out.println(array.remove("world"));
// System.out.println(array.remove("javaee"));
//public E remove(int index)：
// System.out.println(array.remove(1));
//IndexOutOfBoundsException
// System.out.println(array.remove(3));
//public E set(int index,E element)：
// System.out.println(array.set(1,"javaee"));
//IndexOutOfBoundsException
// System.out.println(array.set(3,"javaee"));
//public E get(int index)：
// System.out.println(array.get(0));
// System.out.println(array.get(1));
// System.out.println(array.get(2));
//System.out.println(array.get(3));
//public int size()：
        System.out.println(array.size());

        System.out.println("array:" + array);
    }
}
